//---------------------------------------------------------------------------

#ifndef ConrtolBoardH
#define ConrtolBoardH


typedef enum
{
	BOARD_R_HEAD1				= 0,
	BOARD_R_HEAD2				= 1,
	BOARD_R_DIP					= 2,
	BOARD_R_FALLDOWN  	= 3,
	BOARD_R_INIT		  	= 4,
	BOARD_R_AZIMUTH_L		= 5,
	BOARD_R_AZIMUTH_H		= 6,
	BOARD_R_FORCE_R_L		= 7,
	BOARD_R_FORCE_R_H		= 8,
	BOARD_R_FORCE_L_L		= 9,
	BOARD_R_FORCE_L_H		= 10,
	BOARD_R_CHECKSUM		= 11,
	BOARD_R_LENGTH			= 12
} BoardReceiveDef; // Receive data from ControlBoard;

typedef enum
{
	BOARD_S_HEAD1				= 0,
	BOARD_S_HEAD2				= 1,
	BOARD_S_LED1				= 2,
	BOARD_S_LED2		  	= 3,
	BOARD_S_LED3				= 4,
	BOARD_S_LED4				= 5,
	BOARD_S_LED5		  	= 6,
	BOARD_S_LED6				= 7,
	BOARD_S_CHECKSUM		= 8,
	BOARD_S_LENGTH			= 9
} BoardSendDef; // Sent data to ControlBoard;

typedef struct
{
	unsigned char Buff[BOARD_RX_BUFF_SIZE];
	int NowIndex;
	int EndIndex;
} BoardRXStruct;


extern unsigned char Board_Receive[BOARD_R_LENGTH];
extern unsigned char Board_Send[BOARD_S_LENGTH];
extern BoardRXStruct BoardRX;


void Board_Init(void);
void Board_Receive_Init(void);
void Board_Send_Init(void);
void BoardRX_Init(void);

bool BoardRX2Receive(void);
void BoardSend(void);

//---------------------------------------------------------------------------
#endif
